home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Video
/
World of Video.iso
/
gfxprograms
/
3dprograms
/
rayshade-4.0
/
fixes
/
fix012
< prev
next >
Wrap
Internet Message Format
|
1995-02-13
|
6KB
From theseas!fs.Princeton.EDU!cek Mon, 28 Jun 93 01:31:16 EET
Received: by kriton.UUCP (V1.16/Amiga)
id AA00000; Mon, 28 Jun 93 01:31:16 EET
Received: by theseas.ntua.gr with UUCP; Sat, 26 Jun 93 17:36:52 +0300
Received: from mcsun.EU.net by pythia.ics.forth.gr via ITEnet with SMTP;
id AA07690 (5.65c/FORTH-ICS-3.0-MHS-7.0); Sat, 26 Jun 1993 01:18:02 +0300
Received: by mcsun.EU.net via EUnet
id AA22882 (5.65b/CWI-2.226); Sat, 26 Jun 1993 00:17:50 +0200
Received: from Princeton.EDU by relay2.UU.NET with SMTP
(5.61/UUNET-internet-primary) id AA28262; Fri, 25 Jun 93 18:16:45 -0400
Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.96/princeton)
id AA29672; Fri, 25 Jun 93 15:03:21 -0400
Received: by fs.Princeton.EDU (4.1/1.105)
id AA10836; Fri, 25 Jun 93 15:03:18 EDT
Received: from faui45.informatik.uni-erlangen.de ([131.188.34.45]) by fs.Princeton.EDU (4.1/1.105)
id AA10746; Fri, 25 Jun 93 15:02:31 EDT
Received: from faui43.informatik.uni-erlangen.de by uni-erlangen.de with SMTP;
id AA24455 (5.65c-5/7.3u-FAU); Fri, 25 Jun 1993 21:02:12 +0200
Received: by immd4.informatik.uni-erlangen.de;
id AA06410 (5.65c-5/7.3m-FAU); Fri, 25 Jun 1993 21:02:10 +0200
Message-Id: <199306251902.AA06410@faui43.informatik.uni-erlangen.de>
Date: Fri, 25 Jun 93 21:02:10 METDST
X-Mailer: ELM [version 2.3 PL11]
Errors-To: Princeton.EDU!cek
Remailed-Date: Fri Jun 25 15:02:36 EDT 1993
From: "Michael Schroeder (Inf4 - hiwi)" <immd4.informatik.uni-erlangen.de!mlschroe>
To: "Rayshade Distribution List" <cs.Princeton.EDU!rayshade-users>
Subject: Translucency bugs
Hello Rayshade users,
the following mail was originally sent to Craig, but no response
up to now. I think he has an overfull mailbox again... :-)
Michael.
==================================================================
Hello Craig,
some things I noticed in the translucency implementation:
1) After the translucency is added, the color vector is scaled. This
is not a good thing, because all the contributions of the other
light sources are scaled, too. A solution is to scale the calculated
intensity of the light (i.e. lcolor) before calling Lighting().
2) I don't think that the calculation of cosalpha is correct. In the
current implementation the angle between the reflected ray and the
light ray is used. Shouldn't that be the angle between the original
ray and the light ray?
What do you think?
Michael
---------------------------------------------------------------
Michael Schroeder mlschroe@faui43.informatik.uni-erlangen.de
main(a){while(a=~getchar())putchar(~a-1/(~(a|32)/13*2-11)*13);}
*** shade.c.orig Tue Apr 6 17:45:17 1993
--- shade.c Mon Apr 26 13:45:18 1993
***************
*** 118,125 ****
* Calculate intensity contributed by each light source.
*/
for (lp = Lights; lp; lp = lp->next)
! LightRay(lp, pos, nrm, gnrm, smooth, &refl, surf,
! ray->depth, ray->sample, ray->time, color);
if (ray->depth >= Options.maxdepth)
/*
--- 118,124 ----
* Calculate intensity contributed by each light source.
*/
for (lp = Lights; lp; lp = lp->next)
! LightRay(lp, pos, nrm, gnrm, smooth, &refl, surf, ray, color);
if (ray->depth >= Options.maxdepth)
/*
***************
*** 162,175 ****
* Lighting calculations
*/
static void
! LightRay(lp, pos, norm, gnorm, smooth, reflect, surf, depth, samp, time, color)
Light *lp; /* Light source */
Vector *pos, *norm, *gnorm; /* hit pos, shade norm, geo norm */
int smooth; /* true if shade and geo norm differ */
Vector *reflect; /* reflection direction */
Surface *surf; /* surface characteristics */
! int depth, samp; /* ray depth, sample # */
! Float time;
Color *color; /* resulting color */
{
Color lcolor;
--- 161,173 ----
* Lighting calculations
*/
static void
! LightRay(lp, pos, norm, gnorm, smooth, reflect, surf, oldray, color)
Light *lp; /* Light source */
Vector *pos, *norm, *gnorm; /* hit pos, shade norm, geo norm */
int smooth; /* true if shade and geo norm differ */
Vector *reflect; /* reflection direction */
Surface *surf; /* surface characteristics */
! Ray *oldray; /* indicent ray */
Color *color; /* resulting color */
{
Color lcolor;
***************
*** 177,185 ****
Float costheta, cosalpha, dist;
newray.pos = *pos;
! newray.depth = depth;
! newray.sample = samp;
! newray.time = time;
newray.media = (Medium *)NULL;
LightDirection(lp, pos, &newray.dir, &dist);
--- 175,183 ----
Float costheta, cosalpha, dist;
newray.pos = *pos;
! newray.depth = oldray->depth;
! newray.sample = oldray->sample;
! newray.time = oldray->time;
newray.media = (Medium *)NULL;
LightDirection(lp, pos, &newray.dir, &dist);
***************
*** 212,221 ****
if (!LightIntens(lp, &newray, dist,
(int)surf->noshadow, &lcolor))
return;
! cosalpha = -dotp(reflect, &newray.dir);
Lighting(-costheta, cosalpha, &lcolor, &surf->translu,
&surf->body, surf->stexp, color);
- ColorScale(surf->translucency, *color, color);
} else {
if (!LightIntens(lp, &newray, dist,
(int)surf->noshadow, &lcolor))
--- 210,219 ----
if (!LightIntens(lp, &newray, dist,
(int)surf->noshadow, &lcolor))
return;
! cosalpha = dotp(&oldray->dir, &newray.dir);
! ColorScale(surf->translucency, lcolor, &lcolor);
Lighting(-costheta, cosalpha, &lcolor, &surf->translu,
&surf->body, surf->stexp, color);
} else {
if (!LightIntens(lp, &newray, dist,
(int)surf->noshadow, &lcolor))
----------
Administrivia: rayshade-request@cs.princeton.edu
Mailing list: rayshade-users@cs.princeton.edu